using System;

using System.Xml;

using System.Data;
using Aulac.Global.Enums; using Aulac.Global.Data; using Aulac.Global.Common; using Aulac.Global.Xml;
using System.Windows.Forms;
using Aulac.Client.Connect.Ems;
using System.Collections.Generic;
using Aulac.Verb.Ems;
using Aulac.Rsc.Bss.Tags;
using Aulac.Rsc.Bss;

namespace Aulac.Client.Data.Bss.Helper.DataItems
{
	/// <summary>
	/// Summary description for DataCommon.
	/// </summary>
    public class DataRscFncHelper
	{
        public static void LoadDataRscFnc(Control ctr, int isActive, RscFncTypes pRscTypeID)
        {
            try
            {
                XmlDataDocument doc = DataRequest.CreateXmlDocument(AulacEmsVerb.Items.RscFnc.GetListRscFnc, AulacEmsVerb.Items.Noun.MdnItems.MdnItem);
                XmlProcess.AddValueParamItem(doc, tagGeneral.IsActive, isActive);

                doc = DataRequest.ProcessRequest(doc);
                ((Aulac.Client.Global.Interface.IAulacDataContainerCtrl)ctr).ClearDataContainer();
                XmlNodeList list = XmlProcess.GetListVchLineItem(doc);
                ((Aulac.Client.Global.Interface.IAulacDataContainerCtrl)ctr).AddDataToControl(list);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        
        public static void LoadDataRscFnc(Control ctr, string pRscFncPrkID)
        {
            try
            {
                XmlDataDocument doc = DataRequest.CreateXmlDocument(AulacEmsVerb.Items.RscFnc.GetListRscFnc, AulacEmsVerb.Items.Noun.MdnItems.MdnItem);
                doc = DataRequest.ProcessRequest(doc);
                XmlNodeList list = XmlProcess.GetListVchLineItem(doc);
                ((Aulac.Client.Global.Interface.IAulacDataContainerCtrl)ctr).AddDataToControl(list);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

	}
}
